home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
nihcl-30.lha
/
nihcl-3.0
/
ex
/
ex8-4.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-15
|
578b
|
23 lines
// ex8-4.c -- Incorrectly modifying a container during iteration
// $Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/ex/RCS/ex8-4.c,v 3.0 90/05/15 22:46:19 kgorlen Rel $
#include "OrderedCltn.h"
#include "Iterator.h"
#include "String.h"
main()
{
OrderedCltn symbols;
symbols.add(*new String("A"));
symbols.add(*new String("C"));
symbols.add(*new String("G"));
symbols.add(*new String("T"));
Iterator it(symbols);
while (it++)
if (it()->compare(String("G")) < 0) symbols.remove(*it());
cout << symbols << endl;
}